package com.example.comic.mvp.ppresenter

import com.example.comic.mvp.model.Page
import com.example.comic.mvp.model.Pager
import com.example.comic.mvp.model.getJsonString
import com.google.gson.Gson

class PagePresenter : Presenter<ArrayList<Pager.DataBean.ReturnDataBean.ImageListBean>> {
    override fun obtain(url: String): ArrayList<Pager.DataBean.ReturnDataBean.ImageListBean> {
        val list = ArrayList<Pager.DataBean.ReturnDataBean.ImageListBean>()
        val jsonString = getJsonString(url)
        var pager = Gson().fromJson<Pager>(jsonString, Pager::class.java)
        list.addAll(pager.data.returnData.image_list)
        return list
    }
}